<!--
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-09-28 19:11:16
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-09-28 19:21:15
 * @FilePath: \undefinedc:\Users\ASUS\Desktop\梁志恒\第三阶段\day1\作业\index.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var cartGoods = [
            {
                goodsname: '小米10',
                price: 5000,
                isChecked: true,//代表是否选中了
            },
            {
                goodsname: '苹果10',
                price: 3000,
                isChecked: false,//代表是否选中了
            }
        ]
        for (let i = 0; i < cartGoods.length; i++) {
            //console.log(cartGoods[i])
            if (cartGoods[i].isChecked == true) {
                console.log("被选中")
            } else if (cartGoods[i].isChecked == false) {
                console.log("没有被选中")
            }
        }
    </script>
</body>

</html>